How to : implement user - defined conversions between structs 如何:在結(jié)構(gòu)之間實(shí)現(xiàn)用戶定義的轉(zhuǎn)換
User - defined conversions sample > “用戶定義的轉(zhuǎn)換”示例
Other conversions , such as user - defined conversions , are not considered 不考慮其他轉(zhuǎn)換,如用戶定義的轉(zhuǎn)換。
To build and run the user - defined conversions samples from the command line 從命令行生成并運(yùn)行“用戶定義的轉(zhuǎn)換”示例
How to : implement user - defined conversions between structs c programming guide 如何:在結(jié)構(gòu)之間實(shí)現(xiàn)用戶定義的轉(zhuǎn)換( c #編程指南)
To build and run the user - defined conversions samples within visual studio in 在visual studio中生成并運(yùn)行“用戶定義的轉(zhuǎn)換”示例
Conversion operator design guidelines how to : implement user - defined conversions between structs c programming guide 如何:在結(jié)構(gòu)之間實(shí)現(xiàn)用戶定義的轉(zhuǎn)換( c #編程指南)
Keyword to overload a built - in operator or to provide a user - defined conversion in a class or struct declaration 關(guān)鍵字用于在類或結(jié)構(gòu)聲明中聲明運(yùn)算符。運(yùn)算符聲明可以采用下列四種形式之一:
The as operator cannot perform other conversions , such as user - defined conversions , which should instead be performed using cast expressions 運(yùn)算符無法執(zhí)行其他轉(zhuǎn)換,如用戶定義的轉(zhuǎn)換,這類轉(zhuǎn)換應(yīng)使用cast表達(dá)式來執(zhí)行。
If a user - defined conversion is defined between two data types , the same conversion can also be used with the nullable versions of these data types 如果兩種數(shù)據(jù)類型之間定義了用戶定義的轉(zhuǎn)換,則同一轉(zhuǎn)換也可用于這些數(shù)據(jù)類型的可空版本。